home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / XROADS.CMD < prev   
Encoding:
Text File  |  1996-02-26  |  7.0 KB  |  250 lines

  1. #login.cmd script for Crossroads
  2. #Author: rdc@netcom.duke.edu
  3. $rev_date = "7/6/95"
  4. #Version 1.1
  5. #
  6. #This script has been completely rewritten.
  7. #It now contains descriptive error messages that
  8. #should help us determine just where the problems
  9. #are.  It should also be much more robust. (yeah, sure!)
  10. #
  11. #This script now loops when a busy signal is detected,
  12. #and will loop for the value of %busyout times. Default
  13. #is 100.  If you wish to change it, simply make it
  14. #whatever you like.  %busyout is in the #DEFINE DEBUGGING AND ECHO STATUS
  15. #section below.
  16. #
  17. #The script will now loop through invalid logins/passwords.
  18. #It takes a few seconds to reset, so please be patient!
  19. #
  20. #If you have been having problems with the old script,
  21. #this one should fix most of them...and will give you a
  22. #much more detailed error message to give us!
  23. #We found some modems that returned different connect
  24. #strings and this is what was giving the script indigestion!
  25. #Some modems return CONNECT, some CARRIER, some CONNECTED...sigh
  26. #This is the reason for the "Connect String ==>" display, so
  27. #that if there are any MORE versions of connect strings we
  28. #will know how to hack the script.
  29. #
  30. #Some folks have been having problems with error correction
  31. #and V.42 enabled.  To turn 'em off, just set the Error_V42 =
  32. #line to 1...as in Error_V42 = 1
  33. #To renable, set it to 0.
  34. #You can find this variable in the DEFINE DEBUGGING AND ECHO STATUS section.
  35. #
  36. #We hope that this new script solves most of the
  37. #strangeness that has been going on, but realize that
  38. #there are always little nasty critters lurking about...
  39. #So, please send email to support@xroads.com with
  40. #detailed descriptions of your error messages, type of
  41. #hardware, and anything else you can think of that might
  42. #be useful.
  43. #
  44. #Thanks, and HAPPY SLIPPING!
  45. #
  46. #
  47. #DEFINE DEBUGGING AND ECHO STATUS
  48. trace off
  49. #
  50. # set up some strings for dialling up
  51. #
  52. if ![load $number]
  53.   if [query $number "Enter your dial up phone number"]
  54.     save $number
  55.   end
  56. end
  57. load $username
  58. if $username = "Put_your_PPP_login_here"
  59.     display "login name not set up. Please run SETUP.CMD from the DIALER menu"\n
  60.     abort
  61. end
  62. if ![load $password]
  63.   if [password "Enter your PPP login password"]
  64.     save $password
  65.   end
  66. end
  67. echo off
  68. trace off
  69. %Error_V42 = 0
  70. %connect_status = 0
  71. $resetstring = "ATZ"
  72. $CDstring = "AT&C1"
  73. $userprompt = "ogin:"
  74. $passprompt = "assword:"
  75. $addrtarg = "(204.96.10.11) to"
  76. %busyout = 100
  77. #
  78. #ERROR MESSAGES ARE DEFINED HERE
  79. #
  80. #exec "notepad.exe ds-wmess.txt"
  81. $ERROR_DETECT = "Sequence ERROR! Error Message: "
  82. $no_modem_mess = "LACK OF MODEM RESPONSE!"
  83. $no_modem_mess2 = "Please ensure your com port and modem are working"
  84. $no_modem_mess3 = "correctly and try again.  We're not able to provide"
  85. $no_modem_mess4 = "local hardware support!  Sorry..."
  86. $no_carrier_mess = "CARRIER LOST!"
  87. $no_connect_mess = "CONNECT FAILURE!"
  88. $mail_us_mess = "Please note the ERROR message and email it to:"
  89. $mail_us_mess2 = "This will help us immensely.  Thanks!"
  90. $mail_us_mess3 = "along with a description of your hardware."
  91. $email_mess = "support@xroads.com "
  92. #
  93. #
  94. #BEGIN EXECUTION HERE...
  95. #
  96. #
  97. display \n\n
  98. display "[Crossroads Terminal Server PPP Script v1.0]"\n
  99. display "[Current Revision Date:"$rev_date"]"\n
  100. display "[ExecSequence StartUp.]"\n
  101. display "[Seq1 -- Initializing your modem...]"\n
  102. output $resetstring\r
  103. %timeout = [input 5 OK\n]
  104. #
  105. #look for no response from modem
  106. #
  107. if !%timeout
  108.    display \n$ERROR_DETECT
  109.    display $no_modem_mess\n\n
  110.    display $no_modem_mess2\n\n
  111.    display $no_modem_mess3\n\n
  112.    display $no_modem_mess4\n\n
  113.    abort
  114. end
  115. #
  116. #Fix carrier detect
  117. output $CDstring\r
  118. %timeout = [input 5 OK\n]
  119.  
  120. if !%timeout
  121.    display \n$ERROR_DETECT
  122.    display $no_modem_mess\n\n
  123.    display $no_modem_mess2\n\n
  124.    display $no_modem_mess3\n\n
  125.    display $no_modem_mess4\n\n
  126.    abort
  127. end
  128. display "[Modem initialized OK...]"\n
  129. #check for no error correction or V.42
  130. if %Error_V42
  131.    display "[Disable Error/V42 bit set...Disabling V.42 and DataComp!]"\n
  132.    outputecho 10 at s46=136\r
  133.    %return = [read 5 $return]
  134.       if $return <> "OK"
  135.          display "[MODEM FAILURE --- ABORTING]"\n
  136.          abort
  137.       end
  138.    display "[ --- Turned Data Compression Off OK --- ]"\n
  139.    outputecho 10 at s48=128\r
  140.    %return = [read 5 $return]
  141.    if $return <> "OK"
  142.          display "[MODEM FAILURE --- ABORTING]"\n
  143.          abort
  144.       end
  145.    display "[ --- Turned V.42 Off OK --- ]"\n
  146. end
  147.  
  148. display "[Seq2 -- Dialing Crossroads at "$number"]"\n
  149. #
  150. #modem initialized OK, so begin dialing loop
  151. #
  152. %attempts = 0
  153. repeat
  154.    %attempts = %attempts + 1
  155.    display "    [Dialing Attempt: "%attempts"]"\n
  156.    sleep 5
  157.    outputecho 60 atdt $number\r
  158.    %c3 = [read 90 $status]
  159.    display "[Return Status ==> "$status"]"\n
  160. if $status = "NO DIALTONE"
  161.    display "No Dialtone!  Please check your phone line connection"\n
  162.    display "and try again!"\n
  163.    abort
  164. end
  165. until $status <> "BUSY" | %attempts = %busyout
  166. #
  167. #too many busy signals...give up!
  168. #
  169. if %attempts = %busyout
  170.    display \n"Sorry, but I still could't get through after" %busyout "trys!"\n
  171.    display "Please email support@xroads.com and ask the nice"\n
  172.    display "folks to add some more modems!  Thanks.  Please try again."\n
  173.    sleep 10
  174.    abort
  175. end
  176. #
  177. #OK, got through, now lets see if we synch up..
  178.  
  179.  
  180. $HOOK_MESSAGE  = copy ($status, 1, 3)
  181. display "[Connect String ==> "$HOOK_MESSAGE"]"\n
  182.  
  183. if $HOOK_MESSAGE = "CON"
  184.    %connect_status = 1
  185. end
  186.  
  187. if $HOOK_MESSAGE = "CAR"
  188.    %connect_status = 1
  189. end
  190.  
  191. if !%connect_status
  192.    display \n$ERROR_DETECT
  193.    display $no_connect_mess\n\n
  194.    display $mail_us_mess \n$email_mess$mail_us_mess3\n
  195.    display $mail_us_mess2\n
  196.    abort
  197. end
  198.  
  199. display "[Seq3 -- CONNECT OK...]"\n
  200. #
  201. #  wait till it's safe to send because some modem's hang up
  202. #  if you transmit during the connection phase
  203. #
  204. if [wait 10 dcd]
  205.   display "[Seq4 -- Carrier Detected...]"\n
  206. else
  207.   display "Carrier not detected. Please consult your modem manual and set it"\n
  208.   display "So that DCD follows the carrier signal"\n
  209.   abort
  210. end
  211. #
  212. # now prod the terminal server
  213. #
  214. output \13
  215. #
  216. #loop through until you get your username and password right
  217. #
  218. display "[Seq6 -- Checking your Username and Password...]"\n
  219. #
  220. repeat
  221. echo on
  222.    sleep 1
  223.    input 30 $userprompt
  224.    output $username\13
  225.    input 30 $passprompt
  226.    output $password\13
  227. echo off
  228.    %good2go  = [input 10 PPP session from]
  229.    if !%good2go
  230.       display "Invalid Username or Password...Trying again."\n
  231.    end
  232. until %good2go
  233. #
  234. #you got it...
  235. #now get your address
  236. #
  237. #
  238. #input 30 $addrtarg
  239. #input 30 \n
  240. #address 30
  241. display "   ==> Return Status: PPP OK!"\n
  242. display "[Seq7 -- Your PPP connection into Crossroads is complete!]"\n
  243. display "[ExecSequence End.]"\n\n
  244. display ===========================================================\n\n
  245. display Please minimize this window and fire up your WinSock Apps.\n
  246. display For help, send email to: support@xroads.com\n\n
  247. display ===========================================================\n
  248. display \n\n
  249. #
  250. #DONE!